<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<header class="bg-dark sticky-top" th:fragment="topbar">
    <div class="container">
        &lt;!&ndash; 导航 &ndash;&gt;
        <nav class="navbar navbar-expand-lg navbar-dark">
            &lt;!&ndash; logo &ndash;&gt;
            <a class="navbar-brand" href="#"></a>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            &lt;!&ndash; 功能 &ndash;&gt;
            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav mr-auto">
                    <li class="nav-item ml-3 btn-group-vertical">
                        <a class="nav-link" th:href="@{/index}">首页</a>
                    </li>
                    <li class="nav-item ml-3 btn-group-vertical">
                        <a class="nav-link position-relative" th:href="@{site/letter.html}">消息<span class="badge badge-danger">12</span></a>
                    </li>
                    <li class="nav-item ml-3 btn-group-vertical">
                        <a class="nav-link" th:href="@{/register}">注册</a>
                    </li>
                    <li class="nav-item ml-3 btn-group-vertical">
                        <a class="nav-link" th:href="@{site/login.html}">登录</a>
                    </li>
                    <li class="nav-item ml-3 btn-group-vertical dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            <img src="http://images.nowcoder.com/head/1t.png" class="rounded-circle" style="width:30px;"/>
                        </a>
                        <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                            <a class="dropdown-item text-center" th:href="@{site/profile.html}">个人主页</a>
                            <a class="dropdown-item text-center" th:href="@{site/setting.html}">账号设置</a>
                            <a class="dropdown-item text-center" th:href="@{site/login.html}">退出登录</a>
                            <div class="dropdown-divider"></div>
                            <span class="dropdown-item text-center text-secondary">nowcoder</span>
                        </div>
                    </li>
                </ul>
                &lt;!&ndash; 搜索 &ndash;&gt;
                <form class="form-inline my-2 my-lg-0" action="site/search.html">
                    <input class="form-control mr-sm-2" type="search" aria-label="Search" />
                    <button class="btn btn-outline-light my-2 my-sm-0" type="submit">搜索</button>
                </form>
            </div>
        </nav>
    </div>
</header>
</html>